; stuff
SwapSector		equ 1Ch 			; TI-83+ BE
FATStart		equ 1Bh 			; TI-83+ BE
FSTStart		equ 01h 			; All models
MaxDepth		equ 40				; How many pushes a default stack needs
ThreadSize		equ 8				; Size of Thread Entries
MaxThreads		equ 20
TTSize			equ ThreadSize*MaxThreads	; Size of the Thread Table
INTERRUPT_MASK		equ 00001101b

; RAM Areas
RAMStart		equ 08000h
RAMEnd			equ 0FFFFh
LCDBuffer		equ RAMStart		; 768 bytes
LCDBufferEnd		equ LCDBuffer+768	; 0 bytes
BackBuffer		equ LCDBufferEnd	; 768 bytes
BackBufferEnd		equ BackBuffer+768	; 0 bytes
clip_mask		equ BackBufferEnd	; 1 byte
api_line_color		equ clip_mask+1		; 1 byte
TextX			equ api_line_color+1	; 1 byte
TextY			equ TextX+1		; 1 byte
TextBuffer		equ TextY+1		; 10 bytes
FSTmp			equ TextBuffer+10	; 2 bytes
saveSP			equ FSTmp+2		; 2 bytes
MenuTmp			equ saveSP+2		; 1 bytes
gs_keymem		equ MenuTmp+1		; 2 bytes
MultitaskEnabled	equ gs_keymem+2		; 1 byte
PanelEnabled		equ MultitaskEnabled+1	; 1 byte
OverlayEnabled		equ PanelEnabled+1	; 1 byte
LCDLock			equ OverlayEnabled+1	; 1 byte
CurrentThreadID		equ LCDLock+1		; 1 byte
ThreadTable		equ CurrentThreadID+1	; 160 bytes
ThreadTableEnd		equ ThreadTable+TTSize	; 0 bytes
CurrApp			equ ThreadTableEnd	; 1 byte
AppTbl			equ CurrApp+1		; MaxThreads-2 bytes 
AppTblEnd		equ AppTbl+MaxThreads-2	; 0 bytes
UserRAM 		equ AppTblEnd		; UserRAM to UserRAMEnd
UserRAMEnd 		equ RAMEnd-(MaxDepth*2)

; FAT
FILE_START		equ 4000h	; Start of FAT
FILE_NULL		equ 0
FILE_DELETED_F		equ 1
FILE_DELETED_D		equ 2
;FILE_DELETED_S		equ 3
FILE_FILE		equ 4
FILE_DIRECTORY		equ 5
;FILE_SYMLINK		equ 6
FILE_END		equ 7

; Multitask States
ENABLED			equ 0
CORE_ONLY		equ 1
DISABLED		equ 2

; Thread States
STATE_NONE		equ 0
STATE_ZOMBIE		equ 1
STATE_STARTED		equ 2
STATE_RUNNING		equ 3
STATE_INTERRUPTABLE	equ 4
STATE_UNINTERRUPTABLE	equ 5

; Error codes
SUCCESS			equ 0
ERROR			equ 1
ALLOCATE_SUCCESS	equ 2
ALLOCATE_OUT_OF_MEM	equ 3
MEMORY_CORRUPT		equ 4
FILE_NOT_IN_DIR		equ 5
BAD_PATH		equ 6
END_OF_FAT		equ 7
BAD_ID			equ 8
FILE_IS_NULL		equ 9
OPEN_THREAD_SPACE	equ 10
NO_THREAD_SPACE		equ 11
THREADS_PRESENT		equ 12
NO_THREADS		equ 13
LCD_READY		equ 14
LCD_LOCKED		equ 15
LCD_LOCK_GRANTED	equ 16
; add new errors here and to error.asm
